<template>
	<view>
		<view class="list gray">修改备注</view>
		<view class="list list1">
			<input type="text" v-model="note" />
			<image class="guanbi" @click="guanbi" src="../../static/image/guanbi.png"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				note: ''
			}
		},
		onShow() {
			this.$msgchat.initwork();
		},
		onLoad(options){
			this.id = options.id;
			this.note = options.note;
			// this.initDat();
			// uni.onSocketMessage(function (res) {
			//   console.log('收到服务器内容：' + res.data);
			// });
		},
		methods: {
			//初始化数据
			guanbi() {
				this.note = '';
			},
			//隐藏模态框
		},
		onNavigationBarButtonTap(e) {
			var obj = {
				id : this.id,
				note : this.note
			}
			this.$common.requests('/api/friend/updatenote', obj).then(res => {
				if(res.data.code == 1){
					this.$api.msg(res.data.msg);
					setTimeout(() => {
						uni.navigateBack();
					}, 1000)
				}else{
					this.$api.msg(res.data.msg);
				}
			})
		}
	}
</script>

<style>
	page {
		background: #F5F4F9;
	}

	.list {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 30upx;
		letter-spacing: 3upx;
	}

	.gray {
		color: #787878;
	}

	.list1 {
		background: #FFF;
	}

	.guanbi {
		width: 40upx;
		height: 40upx;
	}

	input {
		width: 85%;
	}

	.quanxian {
		padding: 100upx 0;
		background: #FFF;
		border-bottom: 1px solid #E8E8E8;
		font-weight: 600;
	}

	.solid-left {
		color: #4C68FF;
	}
</style>
